package com.huqing.icu.rentuser.dao;

import com.huqing.icu.rentuser.mapper.UserMapper;
import com.huqing.icu.rentuser.model.User;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description 用户dao
 * @Author huqing
 * @Date 2025/9/3 21:40
 **/
@Repository
public class UserDao {

    @Resource
    private UserMapper userMapper;

    public Integer insert(User user) {
        return userMapper.insert(user);
    }

    public Integer updateById(User user) {
        return userMapper.updateById(user);
    }

    public User getByUserId(Long userId) {
        return userMapper.selectById(userId);
    }

    public List<User> selectByUserIdList(List<Long> userIdList) {
        return userMapper.selectBatchIds(userIdList);
    }
}
